/*
 * @Author: zwf 240970521@qq.com
 * @Date: 2023-07-14 01:12:21
 * @LastEditors: zwf 240970521@qq.com
 * @LastEditTime: 2023-07-23 21:38:15
 * @FilePath: /esp32_cmake_test/pin/inc/pin.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef PIN_H
#define PIN_H

#include "esp_err.h"
#include "soc/soc_caps.h"

typedef enum
{
    PIN_ERROR = -1,
    PIN_GPIO  = 1,
    PIN_SDA,
    PIN_SCL,
    PIN_PWM,
    PIN_ADC,
    PIN_TXD,
    PIN_RXD,
} PinType;

typedef enum
{
    PIN_FREE = 0,
    PIN_USE,
} PinState;

/*注册管脚*/
esp_err_t PIN_register(int pinNum, PinType type);
/*释放管脚*/
esp_err_t PIN_release(int pinNum);
/*获取管脚状态*/
PinType PIN_getState(int pinNum);

#endif
